3.1.85 \(\int \frac {3+x^2}{1+3 x^2+x^4} \, dx\)

Optimal. Leaf size=74 \[ \frac {\left (3+\sqrt {5}\right )^{3/2} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )}{2 \sqrt {10}}-\frac {1}{10} \sqrt {180-80 \sqrt {5}} \tan ^{-1}\left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {1166, 203} \begin {gather*} \frac {\left (3+\sqrt {5}\right )^{3/2} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )}{2 \sqrt {10}}-\frac {1}{10} \sqrt {180-80 \sqrt {5}} \tan ^{-1}\left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(3 + x^2)/(1 + 3*x^2 + x^4),x]

[Out]

-(Sqrt[180 - 80*Sqrt[5]]*ArcTan[Sqrt[2/(3 + Sqrt[5])]*x])/10 + ((3 + Sqrt[5])^(3/2)*ArcTan[Sqrt[(3 + Sqrt[5])/
2]*x])/(2*Sqrt[10])

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rubi steps

\begin {align*} \int \frac {3+x^2}{1+3 x^2+x^4} \, dx &=\frac {1}{10} \left (5-3 \sqrt {5}\right ) \int \frac {1}{\frac {3}{2}+\frac {\sqrt {5}}{2}+x^2} \, dx+\frac {1}{10} \left (5+3 \sqrt {5}\right ) \int \frac {1}{\frac {3}{2}-\frac {\sqrt {5}}{2}+x^2} \, dx\\ &=-\frac {1}{5} \sqrt {45-20 \sqrt {5}} \tan ^{-1}\left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right )+\frac {\left (3+\sqrt {5}\right )^{3/2} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )}{2 \sqrt {10}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 73, normalized size = 0.99 \begin {gather*} \frac {\left (3+\sqrt {5}\right )^{3/2} \tan ^{-1}\left (\sqrt {\frac {1}{2} \left (3+\sqrt {5}\right )} x\right )-\left (3-\sqrt {5}\right )^{3/2} \tan ^{-1}\left (\sqrt {\frac {2}{3+\sqrt {5}}} x\right )}{2 \sqrt {10}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(3 + x^2)/(1 + 3*x^2 + x^4),x]

[Out]

(-((3 - Sqrt[5])^(3/2)*ArcTan[Sqrt[2/(3 + Sqrt[5])]*x]) + (3 + Sqrt[5])^(3/2)*ArcTan[Sqrt[(3 + Sqrt[5])/2]*x])
/(2*Sqrt[10])

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {3+x^2}{1+3 x^2+x^4} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(3 + x^2)/(1 + 3*x^2 + x^4),x]

[Out]

IntegrateAlgebraic[(3 + x^2)/(1 + 3*x^2 + x^4), x]

________________________________________________________________________________________

fricas [B]  time = 1.05, size = 137, normalized size = 1.85 \begin {gather*} \frac {2}{5} \, \sqrt {5} \sqrt {-4 \, \sqrt {5} + 9} \arctan \left (\frac {1}{4} \, \sqrt {2 \, x^{2} + \sqrt {5} + 3} {\left (\sqrt {5} \sqrt {2} + 3 \, \sqrt {2}\right )} \sqrt {-4 \, \sqrt {5} + 9} - \frac {1}{2} \, {\left (\sqrt {5} x + 3 \, x\right )} \sqrt {-4 \, \sqrt {5} + 9}\right ) + \frac {2}{5} \, \sqrt {5} \sqrt {4 \, \sqrt {5} + 9} \arctan \left (\frac {1}{4} \, {\left (\sqrt {2 \, x^{2} - \sqrt {5} + 3} {\left (\sqrt {5} \sqrt {2} - 3 \, \sqrt {2}\right )} - 2 \, \sqrt {5} x + 6 \, x\right )} \sqrt {4 \, \sqrt {5} + 9}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+3)/(x^4+3*x^2+1),x, algorithm="fricas")

[Out]

2/5*sqrt(5)*sqrt(-4*sqrt(5) + 9)*arctan(1/4*sqrt(2*x^2 + sqrt(5) + 3)*(sqrt(5)*sqrt(2) + 3*sqrt(2))*sqrt(-4*sq
rt(5) + 9) - 1/2*(sqrt(5)*x + 3*x)*sqrt(-4*sqrt(5) + 9)) + 2/5*sqrt(5)*sqrt(4*sqrt(5) + 9)*arctan(1/4*(sqrt(2*
x^2 - sqrt(5) + 3)*(sqrt(5)*sqrt(2) - 3*sqrt(2)) - 2*sqrt(5)*x + 6*x)*sqrt(4*sqrt(5) + 9))

________________________________________________________________________________________

giac [A]  time = 0.16, size = 41, normalized size = 0.55 \begin {gather*} \frac {1}{5} \, {\left (2 \, \sqrt {5} - 5\right )} \arctan \left (\frac {2 \, x}{\sqrt {5} + 1}\right ) + \frac {1}{5} \, {\left (2 \, \sqrt {5} + 5\right )} \arctan \left (\frac {2 \, x}{\sqrt {5} - 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+3)/(x^4+3*x^2+1),x, algorithm="giac")

[Out]

1/5*(2*sqrt(5) - 5)*arctan(2*x/(sqrt(5) + 1)) + 1/5*(2*sqrt(5) + 5)*arctan(2*x/(sqrt(5) - 1))

________________________________________________________________________________________

maple [B]  time = 0.02, size = 104, normalized size = 1.41 \begin {gather*} \frac {2 \arctan \left (\frac {4 x}{2 \sqrt {5}-2}\right )}{2 \sqrt {5}-2}+\frac {6 \sqrt {5}\, \arctan \left (\frac {4 x}{2 \sqrt {5}-2}\right )}{5 \left (2 \sqrt {5}-2\right )}+\frac {2 \arctan \left (\frac {4 x}{2 \sqrt {5}+2}\right )}{2 \sqrt {5}+2}-\frac {6 \sqrt {5}\, \arctan \left (\frac {4 x}{2 \sqrt {5}+2}\right )}{5 \left (2 \sqrt {5}+2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+3)/(x^4+3*x^2+1),x)

[Out]

2/(2*5^(1/2)+2)*arctan(4/(2*5^(1/2)+2)*x)-6/5*5^(1/2)/(2*5^(1/2)+2)*arctan(4/(2*5^(1/2)+2)*x)+2/(2*5^(1/2)-2)*
arctan(4/(2*5^(1/2)-2)*x)+6/5*5^(1/2)/(2*5^(1/2)-2)*arctan(4/(2*5^(1/2)-2)*x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^{2} + 3}{x^{4} + 3 \, x^{2} + 1}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+3)/(x^4+3*x^2+1),x, algorithm="maxima")

[Out]

integrate((x^2 + 3)/(x^4 + 3*x^2 + 1), x)

________________________________________________________________________________________

mupad [B]  time = 0.11, size = 117, normalized size = 1.58 \begin {gather*} 2\,\mathrm {atanh}\left (\frac {80\,x\,\sqrt {\frac {\sqrt {5}}{5}-\frac {9}{20}}}{24\,\sqrt {5}-56}-\frac {48\,\sqrt {5}\,x\,\sqrt {\frac {\sqrt {5}}{5}-\frac {9}{20}}}{24\,\sqrt {5}-56}\right )\,\sqrt {\frac {\sqrt {5}}{5}-\frac {9}{20}}-2\,\mathrm {atanh}\left (\frac {80\,x\,\sqrt {-\frac {\sqrt {5}}{5}-\frac {9}{20}}}{24\,\sqrt {5}+56}+\frac {48\,\sqrt {5}\,x\,\sqrt {-\frac {\sqrt {5}}{5}-\frac {9}{20}}}{24\,\sqrt {5}+56}\right )\,\sqrt {-\frac {\sqrt {5}}{5}-\frac {9}{20}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 + 3)/(3*x^2 + x^4 + 1),x)

[Out]

2*atanh((80*x*(5^(1/2)/5 - 9/20)^(1/2))/(24*5^(1/2) - 56) - (48*5^(1/2)*x*(5^(1/2)/5 - 9/20)^(1/2))/(24*5^(1/2
) - 56))*(5^(1/2)/5 - 9/20)^(1/2) - 2*atanh((80*x*(- 5^(1/2)/5 - 9/20)^(1/2))/(24*5^(1/2) + 56) + (48*5^(1/2)*
x*(- 5^(1/2)/5 - 9/20)^(1/2))/(24*5^(1/2) + 56))*(- 5^(1/2)/5 - 9/20)^(1/2)

________________________________________________________________________________________

sympy [A]  time = 0.21, size = 46, normalized size = 0.62 \begin {gather*} 2 \left (\frac {\sqrt {5}}{5} + \frac {1}{2}\right ) \operatorname {atan}{\left (\frac {2 x}{-1 + \sqrt {5}} \right )} - 2 \left (\frac {1}{2} - \frac {\sqrt {5}}{5}\right ) \operatorname {atan}{\left (\frac {2 x}{1 + \sqrt {5}} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+3)/(x**4+3*x**2+1),x)

[Out]

2*(sqrt(5)/5 + 1/2)*atan(2*x/(-1 + sqrt(5))) - 2*(1/2 - sqrt(5)/5)*atan(2*x/(1 + sqrt(5)))

________________________________________________________________________________________